﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using IQKS.AWP.DataAccessLayer;
using IQKS.AWP.BusinessObject;


namespace IQKS.AWP.BusinessAccessLayer
{
    public class ActivityTypeMasterBAL
    {

        public DataSet GetActivityTypeMaster()
        {
            DataSet objDs;
            try
            {
                objDs = new ActivityTypeMasterDAL().GetActivityTypeMaster(0);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }


        public ActivityTypeMasterBO GetActivityTypeMaster(params object[] param)
        {
            
            ActivityTypeMasterBO objLMBo;
            try
            {
                objLMBo = new ActivityTypeMasterBO();
                DataSet objDs;
                objDs = new ActivityTypeMasterDAL().GetActivityTypeMaster(param);
                if (objDs != null)
                {
                    DataTable objDt = objDs.Tables[0];
                    if (objDt != null)
                    {
                        objLMBo.ActivityTypeID = Convert.ToInt32(objDt.Rows[0]["ActivityTypeID"]);
                        objLMBo.ActivityTypeName = Convert.ToString(objDt.Rows[0]["ActivityTypeName"]);
                        objLMBo.ActivityCode = Convert.ToString(objDt.Rows[0]["ActivityTypeCode"]);
                        objLMBo.IsActive = Convert.ToBoolean(objDt.Rows[0]["IsActive"]);
                    }
                    else
                    {
                        objLMBo = null;
                    }
                }

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objLMBo;
        }


        public object SetActivityTypeMaster(params object[] param)
        {
            try
            {
                return new ActivityTypeMasterDAL().SetActivityTypeMaster(param);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }




    }
}
